/**
 * 
 */
package com.adel.springIoc.controller;

import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

import com.adel.springIoc.beans.User;
import com.adel.springIoc.service.UserService;

/**
 * @author adruhora
 * 
 */
public class mainController {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		BeanFactory factory = new ClassPathXmlApplicationContext(
				"appContext.xml");

		UserService usrService = (UserService) factory.getBean("userService");
		User user = new User("lulu", 13);
		usrService.addMyUserToBoard(user);
		User user1 = new User("mumu", 15);
		usrService.addMyUserToBoard(user1);
		List<User> userList = usrService.getAllUsers();
		for (User us : userList) {
			System.out.println(us.toString());
		}
	}
}
